import request from '@/utils/request'



// 获取角色列表
export function getRoleList() {
    return request({
        url: '/role/list',
        method: 'get'
    })
}


export function addRole(role) {
    return request({
        url: '/role/addRole',
        method: 'post',
        data: role
    })
}


export function getRoleListWithPermissions() {
    return request({
        url: '/role/listWithPermissions',
        method: 'get',
    })
}

export function deleteByRoleId(roleId) {
    return request({
        url: `/role/${roleId}`,
        method: 'delete',
    })
}

export function getByRoleId(id) {
    return request({
        url: `/role/${id}`,
        method: 'get',
    })
}

export function updateRole(role) {
    return request({
        url: '/role/updateRole',
        method: 'put',
        data: role
    })
}